<!--继承布局页面-->
@extends('front.common.header')

<!--title-->
@section('title',$result->name.' - 推荐机构 - 充电加油')

<!--头部导航块-->
@section('head')
@parent
@stop

<!--中间类容块-->
@section('content')
<link href="{{ asset('/css/employ/list.css') }}" rel="stylesheet" type="text/css">
<div class="main">
    <div class="content">
        <div class='top-nav'>
    		<ul>
    			{!! $mianbaoxie !!}
    		</ul>
    	</div>
    </div>
    <div class="employ-list">
        <div class="employ-list-left fl">
            <div class="employ-search">
                <div class="employ-line">
                    <div class="orgcontent">
                        <div class="org-top">
                            <div class="org-top-img float-l">
                                <img src="@if(count($result->attachment)>0){{$result->attachment->url}}@else{{asset('/images/t-nopic.jpg')}}@endif" width="266" height="166">
                            </div>
                            <div class="org-top-info float-l ml-40">
                                <div class="org-info-title">{{str_limit($result->name,40)}}</div>
                                <div class="org-info-category color-gray">分类：{{count($result->category)>0?$result->category->cat_name:''}}</div>
                                <div class="org-info-category color-3">电话：{{$result->telphone}}</div>
                                <div class="org-info-category color-3">营业时间：{{$result->show_at}}</div>
                                <div class="org-info-category color-3">
                                    地点：{{str_limit($result->address,50)}}&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a href="javascript:;" title="{{$result->name}}" onclick="showmap('/tmap?id={{$result->id}}','{{$result->name}}');">
                                        <span class="color-green">查看地图</span>
                                    </a>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                    </div>                     
                </div>
                <div class="employ-line bodertop">
                    <div class="orgcontent">
                        <div class="orgcontent-tips-title">机构详情</div>
                        <div class="orgcontent-desc" id="lessdesc">
                            {!! str_limit(strip_tags($result->introduction),500) !!}
                        </div>
                        <div class="orgcontent-desc hide" id="moredesc">
                            {!! $result->introduction !!}
                        </div>
                        @if(strlen($result->introduction) > 500)
                        <div class="orgcontent-desc">
                            <p class="text-right"><a href="javascript:void(0)" id="toshowmoreorg"><span class="font-14 color-green">显示完整</span></a></p>
                        </div>
                        @endif
                        <script type="text/javascript">
							$(function(){
								$("#toshowmoreorg").click(function(){
									if($("#moredesc").hasClass('hide')){
    									$("#moredesc").removeClass('hide');
    									$("#lessdesc").addClass('hide');
    									$(this).find('span').html('隐藏');
									}else{
										$("#moredesc").addClass('hide');
										$("#lessdesc").removeClass('hide');
    									$(this).find('span').html('显示完整');
									}
								});
							})
                        </script>
                    </div>
                </div>
            </div>
            <div class="employ-search mt-20">
                <div class="comment-title boderbtm">课程列表</div>
                <div class="employ-line">
                    <table>
                        <tr>
                            <th width="45%">课程名称</th>
                            <th width="15%">课程类别</th>
                            <th width="15%">评分</th>
                            <th width="15%">学费</th>
                            <th width="10%">评论量</th>
                        </tr>
                        @foreach($result->allclass as $classes)
                        <tr class="bodertop">
                            <td><a href="{{url('/teaches/orgcourse/'.$classes->id)}}">{{$classes->name}}</a></td>
                            <td>{{count($result->category)>0?$result->category->cat_name:''}}</td>
                            <td>{{$classes->score}}</td>
                            <td class="color-9">@if($classes->cost > 0) {{ bccomp($classes->cost,999999,2) == 1 ? '电话咨询':$classes->cost}} @else 电话咨询 @endif</td>
                            <td>{{count($classes->scores)}}</td>
                        </tr>
                        @endforeach
                    </table>
                </div>
            </div>
        </div>
        <div class="employ-list-right fl">
            <div class="employ-list-tips">
	           <div class="tips-title">热门推荐</div>
               <div class="tip-org-content">
                   @foreach($hotcourse as $hcourse)
                   <div class="tip-org-content-img">
                       <a href="{{url('/teaches/orgcourse/'.$hcourse->id)}}">
                       <img src="@if(count($hcourse->attachment)>0){{$hcourse->attachment->url}}@else{{asset('/images/t-nopic.jpg')}}@endif" width="218" height="135">
                       </a>
                   </div>
                   <p><a href="{{url('/teaches/orgcourse/'.$hcourse->id)}}"><span class="font-14 color-6">{{str_limit($hcourse->name,28)}}</span></a></p>
                   <p>
                    <span class="font-12 color-11">@if($hcourse->cost > 0) {{ bccomp($hcourse->cost,999999,2) == 1 ? '电话咨询':$hcourse->cost}} @else 电话咨询 @endif</span>
                    ｜<span class="color-4">@if(!empty($hcourse->organization)){{count($hcourse->organization->category)>0?$hcourse->organization->category->cat_name:''}}@endif</span>
                   </p>
                   @endforeach
               </div>
	       </div>
	       {{--@foreach ($ads_img as $key => $adimg)
	       <div class="employ-list-tips mt-10">
	           <img src="{{$adimg->attachment->url}}">
	       </div>
	       @endforeach --}}
        </div>
        <div class="clearfix"></div>
    </div>
</div>
@stop

<!--底部导航-->
@section('footer')
@parent
@stop